<?php
class Nadeb_Form_Execute
{
	public static function functions($_param,$_AllParams)
	{
		
		foreach($_param as $key => $value)
		{
			if( $key == "options" && count($value) > 1)
			{
				foreach($value as $newKey => $newValue)
					$array[$newValue] = $newValue;
					
				$value = $array;
			}
			
			if ( is_array( $value ) && isset( $value[0] ) && strripos($value[0],"->") )
					$value = call_user_func( str_replace( "execute->","",$value[0] ) );

			if ( !is_array( $value ) && strripos($value,"et_param->") )
			{
				$str   = str_replace('get_param->','',$value);
				if( isset( $_AllParams[$str] ) )
					$value = $_AllParams[$str];
				else
					$value = "";
			}	
			
			if ( !is_array( $value ) && strripos($value,"->randon_date_name") )
				$value = date("Ymd-") . rand(10001,99999);
				
				
				
			$result[$key] = $value;
		}
		
		return $result;
	}
}
